package com.zidian.leader.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.zidian.leader.R;
import com.zidian.leader.api.Constant;
import com.zidian.leader.common.activity.MySwipeBackActivity;

import java.util.HashMap;
import java.util.Map;

import butterknife.Bind;

/**
 * 介绍Activity
 * Created by GongCheng on 2017/2/20.
 */

public class IntroductionActivity extends MySwipeBackActivity {
    @Bind(R.id.introduce_tv)
    TextView introduceTv;

    private String title;
    /**
     * 介绍资源文件Map
     **/
    private static final Map<String, Integer> INTRODUCE = new HashMap<String, Integer>() {
        {
            put(Constant.MenuItemType.RANKING_LIST, R.string.ranking_list);
            put(Constant.MenuItemType.COURSE_LEVEL, R.string.course_level);
            put(Constant.MenuItemType.CLUB_ACTIVITIES, R.string.club_activities);
            put(Constant.MenuItemType.STUDENT_IMPROVEMENT, R.string.student_improvement);
            put(Constant.MenuItemType.TEACHER_IMPROVEMENT, R.string.teacher_improvement);
            put(Constant.MenuItemType.STUDENT_QUALITY, R.string.student_quality);
            put(Constant.MenuItemType.TRAIN, R.string.train);
            put(Constant.MenuItemType.OTHERS, R.string.others);
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        title = getIntent().getStringExtra("title");
        initView();
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_introduction;
    }

    private void initView() {
        actionBar.setHomeAsUpIndicator(R.drawable.ic_arrow_back_24dp);
        actionBar.setTitle(title);
        introduceTv.setText(INTRODUCE.get(title));
    }


}
